# arch.mk for BerkeleyGW codes
#
# Suitable for Ubuntu 10.10 in parallel.
# Install packages: liblapack-dev, fftw-dev, gfortran, g++, mpi-default-dev
# Build BLACS according to http://www.open-mpi.org/faq/?category=mpi-apps#blacs
# Build ScaLAPACK according to http://www.open-mpi.org/faq/?category=mpi-apps#scalapack,
#
# D. Strubbe
# January 2011, UCB

COMPFLAG  = -DPGI
PARAFLAG  = -DMPI
MATHFLAG  = -DUSEFFTW3 -DUSESCALAPACK

#########################################################################
#   NOTE: This arch.mk is used by a buildslave. The compiler flags are  #
#   optimized to debug the code and not for code performance.           #
#########################################################################
FCPP    = cpp -C -nostdinc

MPI_PATH=/home/zju/compiler/HMPI/bin

F90free = $(MPI_PATH)/mpif90 -ffree-form -Wall -pedantic-errors 
LINK    = $(MPI_PATH)/mpif90  -fuse-ld=lld 
FOPTS   = 
FNOOPTS = $(FOPTS)
MOD_OPT = -J 
INCFLAG = -I

C_PARAFLAG  = -DPARA
CC_COMP  = $(MPI_PATH)/mpiCC -Wall -pedantic-errors 
C_COMP  = $(MPI_PATH)/mpicc -Wall -pedantic-errors
C_LINK  = $(MPI_PATH)/mpiCC -no-flang-libs -fuse-ld=lld
C_OPTS  = -O2  
C_DEBUGFLAG =

REMOVE  = /bin/rm -f

# Math Libraries
FFTW_DIR =/home/zju/WORK/rely-pack/fftw
#FFTWLIB      = -L$(FFTW_DIR)/lib/ -lfftw
FFTWINCLUDE  = $(FFTW_DIR)/include
FFTWLIB      = /home/zju/WORK/rely-pack/fftw/lib/libfftw3.a

LAPACKLIB=/usr/lib64/liblapack.so.3 /usr/lib64/libblas.so.3

SCALAPACK_DIR = /home/zju/WORK/rely-pack/scalapack-2.1.0/build/lib
SCALAPACKLIB = $(SCALAPACK_DIR)/libscalapack.a $(LAPACKLIB)


HDF5DIR      = /home/zju/WORK/rely-pack/hdf5
# hdf5 path
HDF5LIB      = $(HDF5DIR)/lib/libhdf5_hl.a  $(HDF5DIR)/lib/libhdf5.a -lz
HDF5INCLUDE  = $(HDF5DIR)/include
TESTSCRIPT = make check-parallel

